<template>
  <div>
    <el-button plain @click="open1">成功</el-button>
    <el-button :plain="true" @click="open2">警告</el-button>
    <el-button :plain="true" @click="open3">消息</el-button>
    <el-button :plain="true" @click="open4">错误</el-button>
  </div>
</template>


<script>
export default {
  name: "MessageView",
  methods: {
    open1() {
      //  code  0   500
      let code = 0
      if (code == 0) {
        this.$message.success('这是成功操作的提示信息')
      } else {
        this.$message.error('这是错误提示信息')
      }

    },
    open2() {
      this.$message({
        type: 'warning',
        message: '这是警告信息',
        showClose: true,
        onClose: () => {
          console.log('信息提示已关闭')
          //  编写业务实现
        }
      })
    },
    open3() {
      this.$message.info('这是普通提示信息')
    },
    open4() {
      this.$message.error('这是错误提示信息')
    }
  }
}
</script>
<style scoped>

</style>